//
//  UIColor+hexStringColor.m
//  DCBDriver
//
//  Created by qr on 16/6/16.
//  Copyright © 2016年 dcb. All rights reserved.
//

#import "UIColor+hexStringColor.h"

@implementation UIColor (hexStringColor)

+ (UIColor *)colorWithHex:(NSString *)hex
{
    unsigned rgbValue = 0;
    NSScanner *scanner = [NSScanner scannerWithString:hex];
    [scanner setScanLocation:1];
    [scanner scanHexInt:&rgbValue];
    return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0
                           green:((rgbValue & 0xFF00) >> 8) / 255.0
                            blue:(rgbValue & 0xFF) / 255.0
                           alpha:1.0];
}


@end
